<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@page import="com.ubst.smartad.common.*" %>
<%@page import="com.ubst.smartad.env.*" %>
<%@page import="com.ubst.smartad.session.*" %>
<%@page import="com.ubst.smartad.logger.Debug" %>
<%@page import="net.sf.json.JSONArray"  %>
<%@page import="net.sf.json.JSONObject"  %>
<%@page import="java.util.HashMap" %>
<%@page import="java.util.ArrayList" %>
<%@page import="java.util.List" %>
<%@page import="java.io.PrintWriter" %>
<%@page import="com.ubst.smartad.dbpool.TransactionManager" %>
<%@page import="com.ubst.smartad.impl.admin.account.AccountMngImpl" %>
<%@include file="/jsp/inc/base.jsp"%>

<jsp:useBean id="tem" class="com.ubst.smartad.template.Template" scope="page"/>
<% 
// tem.setFileText( web_root+"skin1/test/test.html");
// tem.setReplaceKey("{TEST}", "aabbcc");

try{
	System.out.println("<!> checkRole ");
	System.out.println("request.getParameterMap() "+request.getParameterMap());
	
	/*
	*	setting
	*
	*//////////////////
	Boolean result = null;

	String lock_group_name = request.getParameter("lock_group_name");
	///////////////////

	AccountMngImpl accountMng = null;
	TransactionManager tm = new TransactionManager();
	
	accountMng = new AccountMngImpl(tm.connection, serverName, fhostEnv.getLogLevel());
	result = accountMng.checkRole(lock_group_name);// delete result
	
	//JSONArray jsonArr = JSONArray.fromObject(workMap);
	JSONObject jsonObj = new JSONObject();
	if(result){
		jsonObj.put("result", "사용할수 있는 ID 입니다");		// result
	}else{
		jsonObj.put("result", "이미 사용중인 ID 입니다");
	}
	
	response.setContentType("text/plain; charset=utf-8"); 
	response.setHeader("Cache-Control", "no-cache"); 
	//PrintWriter out = response.getWriter();
	out.print(jsonObj.toString());
	System.out.println("jsonObj.toString() "+jsonObj.toString());
	out.flush();
}catch (Exception e) {			
}

%>			